package com.example.hot100;

import com.example.tree.TreeNode;

public class Leetcode226_InvertTree {
    public static void main(String[] args) {

    }

    static class Solution {
        public TreeNode invertTree(TreeNode root) {
            if (root == null) return root;
            TreeNode tmp = root.left;
            root.left = root.right;
            root.right = tmp;
            invertTree(root.left);
            invertTree(root.right);

            return root;
        }
    }
}
